import os



## WEBSERVER
SERVER_IP = "127.0.0.1"
if os.environ["SERVER_IP"] != None:
    SERVER_IP = os.environ["SERVER_IP"]

SERVER_PORT = 5600
if os.environ["SERVER_PORT"] != None:
    SERVER_PORT = int(os.environ["SERVER_PORT"])

WEB_TOTOKEN_SAULT = "ssdaeww^%^&$&*fgvhDR"
if os.environ["WEB_TOTOKEN_SAULT"] != None:
    WEB_TOTOKEN_SAULT = os.environ["WEB_TOTOKEN_SAULT"]

# second
WEB_TOTOKEN_DURATION = 600
if os.environ["WEB_TOTOKEN_DURATION"] != None:
    WEB_TOTOKEN_DURATION = int(os.environ["WEB_TOTOKEN_DURATION"])

# default avatar path
DEFAULT_AVATAR = "2024-03/esheeper.png"

# default static path
DEFAULT_STATIC_PATH = "./static"
if os.environ["DEFAULT_STATIC_PATH"] != None:
    DEFAULT_STATIC_PATH = os.environ["DEFAULT_STATIC_PATH"]

# default knowledge hub
DEFAULT_KNOWLEDGE_HUB_PATH = "./knowledge"
if os.environ["DEFAULT_KNOWLEDGE_HUB_PATH"] != None:
    DEFAULT_KNOWLEDGE_HUB_PATH = os.environ["DEFAULT_KNOWLEDGE_HUB_PATH"]


## MYSQL 
MYSQL_IP = "192.168.119.128"
if os.environ["MYSQL_IP"] != None:
    MYSQL_IP = os.environ["MYSQL_IP"]

MYSQL_PORT = "3306"
if os.environ["MYSQL_PORT"] != None:
    MYSQL_PORT = os.environ["MYSQL_PORT"]

MYSQL_DATABASE = "cbgpt"
if os.environ["MYSQL_DATABASE"] != None:
    MYSQL_DATABASE = os.environ["MYSQL_DATABASE"]
    
MYSQL_USERNAME = "root"
if os.environ["MYSQL_USERNAME"] != None:
    MYSQL_USERNAME = os.environ["MYSQL_USERNAME"]

MYSQL_PASSWORD = 123456
if os.environ["MYSQL_PASSWORD"] != None:
    MYSQL_PASSWORD = os.environ["MYSQL_PASSWORD"]



## Milvus
MILVUS_IP = "192.168.119.128"
if os.environ["MILVUS_IP"] != None:
    MILVUS_IP = os.environ["MILVUS_IP"]
    
MILVUS_PORT = 19530
if os.environ["MILVUS_PORT"] != None:
    MILVUS_PORT = int(os.environ["MILVUS_PORT"])
    


## LLM LangChain
LLM_ADDR = "http://127.0.0.1:8000/v1/chat/completions"
if os.environ["LLM_ADDR"] != None:
    LLM_ADDR = os.environ["LLM_ADDR"]
    
LLM_NAME = "chatglm3-6b-32k"
if os.environ["LLM_NAME"] != None:
    LLM_NAME = os.environ["LLM_NAME"]



__all__ = [
    SERVER_IP, SERVER_PORT, WEB_TOTOKEN_SAULT, WEB_TOTOKEN_DURATION, 
    MYSQL_IP, MYSQL_PORT, MYSQL_DATABASE, MYSQL_USERNAME, MYSQL_PASSWORD,
    MILVUS_IP, MILVUS_PORT,
    LLM_ADDR, LLM_NAME
    ]
